{extend  name="manage@public/layout" /}
{block name="content"}
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element" style="text-align: center;">
                            <span><img alt="image" class="img-circle" src="/static/images/profile_small.jpg" /></span>
                            
                                
                            <span class="block"><strong class="font-bold">&nbsp;&nbsp;</strong></span>
                            <span class="text-muted text-xs block">
                                {eq name="auth_mch->is_agent" value='2'}代理费率：{$auth_mch->agent_rate|abs}{else/}{$auth_mch->mch}{/eq}
                            </span>
                            
                        </div>
                        <div class="logo-element">W</div>
                    </li>
                    {volist name="menu" id="vo"}
                    <li>
                        <a>
                            <i class="fa {$vo.icon}"></i>
                            <span class="nav-label">{$vo.title}</span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            {volist name="$vo.children" id="v"}
                            <li>
                                <a class="J_menuItem" href="/{$v.action}" >{$v.title}</a>
                            </li>
                            {/volist}
                        </ul>
                    </li>
                    {/volist}
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header">
                        <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                    </div>
                    <ul class="nav navbar-top-links navbar-right"> 
                       
                        <li class="dropdown hidden-xs">
                            <a onclick="location.reload()" class="right-sidebar-toggle" aria-expanded="false">
                                <i class="fa fa-refresh"></i> 页面刷新
                            </a>
                        </li>
                        <li class="dropdown hidden-xs">
                            <a onClick="modaldemo()" href="javascript:void(0);" class="right-sidebar-toggle" aria-expanded="false">
                                <i class="fa fa-edit"></i> 修改密码
                            </a>
                        </li>
                        <li class="dropdown hidden-xs">
                            <a href="{:url('web/login/logout')}" id="logout" class="right-sidebar-toggle" aria-expanded="false">
                                <i class="fa fa-sign-out"></i> 退出
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
            <div class="row content-tabs">
                <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
                </button>
                <nav class="page-tabs J_menuTabs">
                    <div class="page-tabs-content">
                        <a href="javascript:;" class="active J_menuTab" data-id="{:url('web/index/welcome')}">首页</a>
                    </div>
                </nav>
                <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i></button>
                <div class="btn-group roll-nav roll-right">
                    <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

                    </button>
                    <ul role="menu" class="dropdown-menu dropdown-menu-right">
                        <li class="J_tabShowActive"><a>定位当前选项卡</a>
                        </li>
                        <li class="divider"></li>
                        <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                        </li>
                        <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="{:url('/web/welcome')}" frameborder="0" data-id="/web/welcome.html" seamless></iframe>
            </div>
            <div class="footer">
                <div style="text-align: center;" class="">&copy; 创想支付 </div>
            </div>
        </div>
        <!--右侧部分结束-->
    </div>
     <!--  弹出层  --> 
     <div id="modal-demo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">修改密码</h3>
                    <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">旧密码</label>
                        <div class="col-sm-7">
                            <input type="password" name="old_password" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">新密码</label>
                        <div class="col-sm-7">
                            <input type="password" name="password" class="form-control">
                        </div>
                    </div>
                </div>
                 <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">确认密码</label>
                        <div class="col-sm-7">
                            <input type="password" name="pwd" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary btn-pwd">确定</button>
                    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
                </div>
            </div>
        </div>
    </div>
    <!--  弹出层end  --> 
    {/block}
    {block name="script"}
<script>
	 function modaldemo(){

	    $("#modal-demo").modal("show")
    }
    $(".btn-pwd").click(function(){
        var old_pwd = $("input[name='old_password']").val();
        var new_pwd = $("input[name='password']").val();
        var pwd = $("input[name='pwd']").val();
        if(old_pwd == ''){
            parent.layer.msg("旧密码不能为空");
            return false;
        }
        if(new_pwd == ''){
            parent.layer.msg("新密码不能为空");
            return false;
        }
        if(old_pwd == new_pwd){
            parent.layer.msg("新密码不能和旧密码一样");
            return false;
        }
        if(new_pwd.length < 6 || new_pwd.length > 12){
            parent.layer.msg("新密码在6-12位以内");
            return false;
        }
        if(new_pwd != pwd){
            parent.layer.msg("两次密码不一致");
            return false;
        }
        $.post("/web/pwd",{old_pwd:old_pwd,new_pwd:new_pwd,pwd:pwd},function(result){
            parent.layer.msg(result.msg);
            $("#modal-demo").modal("hide")
        });
    })
</script>
 {/block}
